from api.ihrm_login_api import IHRMLoginAPL
from common.assert_util import AssertUtil


class TestIHRMLogin:

    # 登录成功
    def test_login_success(self):
        json_data = {"mobile": "13800000002", "password": "123456"}
        resp = IHRMLoginAPL.login_api(json_data)
        AssertUtil.ihrm_assert(resp, 200, True, 10000, '操作成功！')

    # 账号错误
    def test_username_error(self):
        json_data = {"mobile": "138000000021", "password": "123456"}
        resp = IHRMLoginAPL.login_api(json_data)
        AssertUtil.ihrm_assert(resp, 200, False, 20001, '用户名或密码错误')

    # 密码错误
    def test_password_error(self):
        json_data = {"mobile": "13800000002", "password": "1234561"}
        resp = IHRMLoginAPL.login_api(json_data)
        AssertUtil.ihrm_assert(resp, 200, False, 20001, '用户名或密码错误')

